﻿@using Core.Models;
@using System.Web.Mvc;
@model Core.Models.Post
@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout_Guest2.cshtml";
    var content = Server.HtmlDecode(Model.Content);
    var newComment = new Comment();
    newComment.PostId = Model.Id;
}
<style>
    .margin-top-20
    {
        margin-top: 20px;
    }
    #new_comment
    {
        width: 70%;
    }
</style>
<div class="panel panel-success">
    <div class="panel-heading">
        <h2 class="panel-title">
            @Html.DisplayFor(model => model.Title)</h2>
    </div>
    <div class="panel-body">
        <div class="panel-body-createddate">
            @Html.DisplayFor(model => model.CreatedDate)
        </div>
        <div class="panel-body-content">
            @*@Html.Raw(Model.Content)*@
            @Html.Raw(content)
        </div>
        <div id="comment_entries" class="margin-top-20">            
            @*@Html.Partial("_ViewComments", Model.Comments)*@
            @{ Html.RenderAction("ViewComments", "Comment", new { postId = Model.Id, isAuthorized = false }); }
        </div>
        <div id="new_comment" class="margin-top-20">
            @*@{ Html.RenderAction("Create", "Comment", new { postId = Model.Id }); }*@
            @{ Html.RenderAction("Create", "Comment", new { postId = Model.Id, comment = newComment }); }
        </div>
    </div>
</div>
